From: Florian Müllner Date: Wed, 5 Jun 2013 12:17:20 +0000 (+0200) Subject: dash: Use a single code path for clearing the drag placeholder X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4078 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1902f4773bcff4b8123393c5c2742d79db6842a8;p=gnome-shell.git dash: Use a single code path for clearing the drag placeholder We currently only keep track of old placeholders when moving past the dragged app's current favorite position, as this is the only case where we need to worry about jitter. Still, moving it into _clearDragPlaceholder() allows us to consolidate code paths, which is a good thing ... https://bugzilla.gnome.org/show_bug.cgi?id=684618 --- diff --git a/js/ui/dash.js b/js/ui/dash.js index d6fd14cff..79636fc49 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -791,7 +791,12 @@ const Dash = new Lang.Class({ _clearDragPlaceholder: function() { if (this._dragPlaceholder) { + this._animatingPlaceholdersCount++; this._dragPlaceholder.animateOutAndDestroy(); + this._dragPlaceholder.connect('destroy', + Lang.bind(this, function() { + this._animatingPlaceholdersCount--; + })); this._dragPlaceholder = null; } this._dragPlaceholderPos = -1; @@ -828,16 +833,7 @@ const Dash = new Lang.Class({ // Don't allow positioning before or after self if (favPos != -1 && (pos == favPos || pos == favPos + 1)) { - if (this._dragPlaceholder) { - this._dragPlaceholder.animateOutAndDestroy(); - this._animatingPlaceholdersCount++; - this._dragPlaceholder.connect('destroy', - Lang.bind(this, function() { - this._animatingPlaceholdersCount--; - })); - } - this._dragPlaceholder = null; - + this._clearDragPlaceholder(); return DND.DragMotionResult.CONTINUE; }